package com.shanghaiyimu.yimiyangche.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2017/7/6.
 */

public class MyFragmentViewPagerAdapter extends FragmentPagerAdapter {

    private FragmentManager fragmentManager;
    private List<Fragment> listFragment;

    public MyFragmentViewPagerAdapter(FragmentManager fm,List<Fragment> listFragment) {
        super(fm);
        this.fragmentManager = fm;
        this.listFragment = listFragment;
    }

    @Override
    public Fragment getItem(int position) {
        return listFragment.get(position);
    }

    @Override
    public int getCount() {
        return listFragment!=null?listFragment.size():0;
    }
}
